#ifndef __GTKUTILS_EXTENSION__H__
#define __GTKUTILS_EXTENSION__H__

#include "gtkutils.h"

createGAsyncReadyCallbackSourceObjectFunc(clicked_action_paste_receiver, GdkClipboard, GtkEntry) {
    GError *error = NULL;

#if GTK_MAJOR_VERSION == 3
    entrySetText(user_data, text);
#endif
#if GTK_MAJOR_VERSION == 4
    gchar *text;
    if((text = clipboardReadTextFinish(source_object, result, &error))) {
        entrySetText(user_data, text);
        free(text);
    }
#endif
}

createSignalObjectFunc(clicked_action_paste_entry, GtkEntry) {
    GdkClipboard *clipboard = createClipboardWithWidget(widget);
    clipboardReadTextAsync(clipboard, NULL, clicked_action_paste_receiver, user_data);
}

#endif  //!__GTKUTILS_EXTENSION__H__